package com.dao.other;

import javax.sql.DataSource;

import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests;

import com.ibatis.sqlmap.client.SqlMapClient;

public class SpringConfTest extends AbstractTransactionalDataSourceSpringContextTests {

	protected String[] getConfigLocations() {
		String[] config = new String[] { "classpath:ibatis-spring.xml" };
		this.setDefaultRollback(false);
		return config;
	}

	protected void onSetUpBeforeTransaction() throws Exception {
		super.onSetUpBeforeTransaction();
	}

	protected void onTearDownInTransaction() throws Exception {
		super.onTearDownInTransaction();
	}

	public void testDataSource() {
		DataSource ds = (DataSource) this.applicationContext.getBean("dataSource");
		assertNotNull(ds);
	}

	public void testSessionFactory() {

		SqlMapClient sf = (SqlMapClient) this.applicationContext.getBean("sqlMapClient");
		assertNotNull(sf);
	}
}
